/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cellstore.entidad;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author paescobar
 */
@Entity
@Table(name = "tb_dominio")
@NamedQueries({
    @NamedQuery(name = "TbDominio.findAll", query = "SELECT t FROM TbDominio t"),
    @NamedQuery(name = "TbDominio.findByIdDominio", query = "SELECT t FROM TbDominio t WHERE t.idDominio = :idDominio"),
    @NamedQuery(name = "TbDominio.findByDescripcion", query = "SELECT t FROM TbDominio t WHERE t.descripcion = :descripcion"),
    @NamedQuery(name = "TbDominio.findByAbreviatura", query = "SELECT t FROM TbDominio t WHERE t.abreviatura = :abreviatura")})
public class TbDominio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GenericGenerator(name="kaugen", strategy ="increment")
    @GeneratedValue(generator="kaugen")
    @Basic(optional = false)
    @Column(name = "id_dominio")
    private Integer idDominio;
    @Basic(optional = false)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @Column(name = "abreviatura")
    private String abreviatura;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tbDominio")
    private Collection<TbParametro> tbParametroCollection;

    public TbDominio() {
    }

    public TbDominio(Integer idDominio) {
        this.idDominio = idDominio;
    }

    public TbDominio(Integer idDominio, String descripcion, String abreviatura) {
        this.idDominio = idDominio;
        this.descripcion = descripcion;
        this.abreviatura = abreviatura;
    }

    public Integer getIdDominio() {
        return idDominio;
    }

    public void setIdDominio(Integer idDominio) {
        this.idDominio = idDominio;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getAbreviatura() {
        return abreviatura;
    }

    public void setAbreviatura(String abreviatura) {
        this.abreviatura = abreviatura;
    }

    public Collection<TbParametro> getTbParametroCollection() {
        return tbParametroCollection;
    }

    public void setTbParametroCollection(Collection<TbParametro> tbParametroCollection) {
        this.tbParametroCollection = tbParametroCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDominio != null ? idDominio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbDominio)) {
            return false;
        }
        TbDominio other = (TbDominio) object;
        if ((this.idDominio == null && other.idDominio != null) || (this.idDominio != null && !this.idDominio.equals(other.idDominio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mycompany.mavenproject2.TbDominio[ idDominio=" + idDominio + " ]";
    }
    
}
